package com.loong.user.business;

import com.loong.common.mybatis.business.AbstractBusiness;
import com.loong.user.mapper.MemberMapper;
import com.loong.user.model.Member;
import com.loong.user.result.MemberDetail;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class MemberBusiness extends AbstractBusiness<Member> {

    @Resource
    private MemberMapper memberMapper;
    /**
     * 根据userId获取会员信息
     */
    public MemberDetail getByMemberId(Long memberId){
        return memberMapper.findDetail(memberId);
    }
    public Member findByUserId(Long userId){
        return selectOne(Member.builder().userId(userId).build());
    }
}
